package com.kksoft.android.xiaoliaobaike;

import net.tsz.afinal.FinalActivity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import android.widget.Toast;

public class ArticleActivity extends FinalActivity {

	// @ViewInject(id = R.id.articleImg)
	// ImageView img;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);// 取消标题栏
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// 全屏
		setContentView(R.layout.activity_article);
		

		final String originalUrl = getIntent().getStringExtra("originalUrl");

		WebView webView = (WebView) findViewById(R.id.webView);
		if (originalUrl == null || originalUrl.length() == 0) {
			Toast.makeText(this, "url为空！", Toast.LENGTH_SHORT).show();
			finish();
		} else {
			//Toast.makeText(this, "url：" + originalUrl, Toast.LENGTH_SHORT)
			//		.show();
			webView.loadUrl(originalUrl);
			
//			GestureDetector mGestureDetector = new GestureDetector(this, new SimpleOnGestureListener(){
//				@Override
//				public boolean onDoubleTapEvent(MotionEvent e) {
//					
//					return super.onDoubleTapEvent(e);
//				}
//			});
		}

		// if (originalUrl != null && originalUrl.length() > 0) {
		// new Thread() {
		// public void run() {
		// Looper.prepare();
		// FinalBitmap fb = new FinalBitmap(ArticleActivity.this).init();
		// fb.configBitmapLoadThreadSize(5);
		// fb.configDiskCacheSize(1024 * 1024 * 500);
		// fb.configDiskCachePath("/sdcard/XiaoLiaoBaiKe/");
		// fb.configMemoryCacheSize(1024 * 1024 * 5);
		//
		// fb.display(img,
		// "http://www.baidu.com/img/baidu_sylogo1.gif");//originalUrl.toString());
		// Looper.loop();
		// };
		// }.start();
		// }

	}
}
